﻿namespace Yom.WebService.Admin
{
    using System.Web;
    using Yom.Common;

    public class AdminBase
    {
        protected Yom.Model.Admin Administrator = SiteLoad.Admin;
        protected HttpResponse Response = HttpContext.Current.Response;

        public void IsLogin()
        {
            if (this.Administrator == null || this.Administrator.AdminID <= 0)
            {
                this.Response.Write("0");
                this.Response.End();
            }
        }

        public void CheckAdmin()
        {
            if (this.Administrator != null && this.Administrator.AdminID > 0)
            {
                this.Response.Write("1");
            }
            else
            {
                this.Response.Write("0");
                this.Response.End();
            }
        }
    }
}